package com.yonder.testunsafe;

public class TestThread {

	static class T {
		long t1 = 0;
		long t2 = 0;
		long t3 = 0;
		public T() {
			t1 = 1;
			t2 = 1;
			t3 = 1;
		}
	}
	
	static T t = null;
	
	static T getT() {
		if (t == null) {
			t = new T();
		}
		if (t.t1 != 1 || t.t2 != 1 || t.t3 != 1) {
			System.err.println("Error");
		}
		return t;
	}
	
	static void t() {
		new Thread(()->{
			getT();
		}).run();
	}
	
	public static void main(String[] args) {
		for (int i = 0; i < 10000000; i++) {
			t();
		}
	}
}
